From: awilliam@xenbuild.aw Date: Tue, 11 Jul 2006 18:53:04 +0000 (-0600) Subject: [IA64] fix usage of ia64_xen_vector X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15786^2~30 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=d7fc7d3d9b07d2ba3b84e29bf2bb9b23aa8a1f5b;p=xen.git [IA64] fix usage of ia64_xen_vector Must look up the vector via the GSI to test if it's in use. Signed-off-by: Alex Williamson --- diff --git a/xen/arch/ia64/linux-xen/iosapic.c b/xen/arch/ia64/linux-xen/iosapic.c index 2be8374f2a..29a20c58df 100644 --- a/xen/arch/ia64/linux-xen/iosapic.c +++ b/xen/arch/ia64/linux-xen/iosapic.c @@ -1155,7 +1155,7 @@ int iosapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval) int iosapic_guest_write(unsigned long physbase, unsigned int reg, u32 val) { - unsigned int id, gsi, vec, dest, high32; + unsigned int id, gsi, vec, xen_vec, dest, high32; char rte_index; struct iosapic *ios; struct iosapic_intr_info *info; @@ -1185,13 +1185,17 @@ int iosapic_guest_write(unsigned long physbase, unsigned int reg, u32 val) /* Sanity check. Vector should be allocated before this update */ if ((rte_index > ios->num_rte) || - test_bit(vec, ia64_xen_vector) || ((vec > IA64_FIRST_DEVICE_VECTOR) && (vec < IA64_LAST_DEVICE_VECTOR) && (!test_bit(vec - IA64_FIRST_DEVICE_VECTOR, ia64_vector_mask)))) return -EINVAL; gsi = ios->gsi_base + rte_index; + xen_vec = gsi_to_vector(gsi); + if (xen_vec >= 0 && test_bit(xen_vec, ia64_xen_vector)) { + printk("WARN: GSI %d in use by Xen.\n", gsi); + return -EINVAL; + } info = &iosapic_intr_info[vec]; spin_lock_irqsave(&irq_descp(vec)->lock, flags); spin_lock(&iosapic_lock);